home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectPlay / Chat / modDplay.bas < prev    next >
BASIC Source File  |  2001-10-08  |  1KB  |  49 lines

  1. Attribute VB_Name = "modDplay"
  2. Option Explicit
  3. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  4. '
  5. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  6. '
  7. '  File:       modDplay.bas
  8. '
  9. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  10.  
  11. Public Enum vbDplayChatMsgType
  12.     MsgChat
  13.     MsgWhisper
  14. End Enum
  15.  
  16. 'Constants
  17. Public Const AppGuid = "{EABD4D9B-6AA9-4c24-9D10-1A6701B07342}"
  18.  
  19. Public dx As DirectX8
  20. Public dpp As DirectPlay8Peer
  21.  
  22. 'App specific variables
  23. Public gsUserName As String
  24. 'Our connection form and message pump
  25. Public DPlayEventsForm As DPlayConnect
  26.  
  27. Public Sub InitDPlay()
  28.     'Create our DX/DirectPlay objects
  29.     Set dx = New DirectX8
  30.     Set dpp = dx.DirectPlayPeerCreate
  31. End Sub
  32.  
  33. Public Sub Cleanup()
  34.     If Not (DPlayEventsForm Is Nothing) Then
  35.         If Not (dpp Is Nothing) Then dpp.UnRegisterMessageHandler
  36.         'Get rid of our message pump
  37.         DPlayEventsForm.GoUnload
  38.         'Close down our session
  39.         If Not (dpp Is Nothing) Then dpp.Close
  40.         DPlayEventsForm.DoSleep 50
  41.         'Lose references to peer and dx objects
  42.         Set dpp = Nothing
  43.         Set dx = Nothing
  44.     End If
  45.     Set DPlayEventsForm = Nothing
  46. End Sub
  47.  
  48.  
  49.